$(function () {
    Mdesignprocedure();
})
function Mdesignprocedure() {
    $("#MdesignprocedureTable").bootstrapTable({
        //请求方式  get请求中文会乱码，建议使用post请求
        method: 'post',
        //请求头部的设置
        contentType: 'application/json',
        //url
        url: '/Dflile.do/PageInfo',
        //设置交替行样式
        striped: true,
        //初始显示页号
        pageNumber: 1,
        //设置表格高度
        //height: 350,
        //是否显示分页
        pagination: true,
        //设置是服务端分页还是客户端分页
        sidePagination: 'server',
        //页大小
        pageSize: 5,
        //分页列表
        pageList: [3, 5, 6, 10],
        queryParams: function (params) {
            return {
                num: params.offset / params.limit + 1,
                size: params.limit
            }
        },
        //上传到服务端的参数
        columns: [
            {title: "产品编号", field: "productid", align: 'center'},
            {title: "产品名称", field: "productname", align: 'center'},
            {title: "档次级别", field: "productclass", align: 'center',
                formatter: function (vale, row, index) {
                    let str = vale=='D001-1'?'高档':vale=='D001-2'?'中档':'低档';
                    return str;
                }},
            {title: "I级分类", field: "firstkindname", align: 'center'},
            {title: "II级分类", field: "secondkindname", align: 'center'},
            {title: "III级分类", field: "thirdkindname", align: 'center'},
            {
                title: "产品经理", field: "responsibleperson", align: 'center',
                formatter: function (vale, row, index) {
                    let Df = JSON.stringify(row)
                    let del_btn = "<button class='btn btn-danger' onclick='delTech(" + Df + ")'>制定设计单</button>";
                    return del_btn;
                }
            },
        ]
    })
}

function delTech(d) {
    localStorage.setItem("Mdesignprocedures",JSON.stringify(d));
    localStorage.removeItem("M_list")
    location.href="../../li_meng/mApplyAdd(2).html";
}

/*// 刷新页面
function load() {
    $("#MdesignprocedureTable").bootstrapTable("refresh")
}*/
